<div class="information">
    <div class="head_title">
        <span class="jump-color" ui-sref="main.message">通知管理</span>
        <span class="tit-color"> / 通知创建</span>
    </div>
    <form class="form-horizontal  w5c-form  content-margin" w5c-form-validate name="mainForm" style="margin-top: 15px">


        <section class="fg-section" style="padding-top: 30px">

            <div class="form-group personal-second">
                <label class="col-sm-2 control-label"><i class="red-icon">*</i>标题：</label>
                <div class="col-sm-8 personal-head">
                    <input type="text" class="input" placeholder="标题" ng-model="formData.title"
                           name="title" required="" ng-maxlength="50" ng-minlength="2">

                    <div style="margin-top: 5px;margin-left: -7px">
                        <label class="pb-2" ng-repeat="title in titleStyles" style="cursor: pointer">
                            <input type="checkbox" ng-model="title.checked" id="check{{title.key}}"
                                   class="magic-checkbox">
                            <label for="check{{title.key}}" style="padding-top: 2px;"></label>
                            {{title.value}}
                        </label>
                    </div>
                </div>

            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label"><i class="red-icon">*</i>对象：</label>
                <div class="col-sm-8 personal-head">
                    <input type="button" class="btn btn-primary" value="选择CP" ng-click="cpSelect()">
                    <br>
                    <label ng-repeat="cp in selectCPs"
                           style="margin-top:5px;padding:5px 10px;background-color: gainsboro">
                        <span>{{cp.userName}}</span><i class="fa fa-times" aria-hidden="true" style="float: right;cursor: pointer; margin-top: 2px;margin-left: 6px;"
                                                       ng-click="deleteSelectCP($index)"></i>
                    </label>

                    <input type="number" hidden ng-model="selectCPs.length" min="1" name="cpSelected">
                </div>
            </div>

            <div class="form-group personal-second">
                <label class="col-sm-2 control-label"><i class="red-icon">*</i>摘要：</label>
                <div class="col-sm-8 personal-head">

                    <textarea placeholder="摘要最多100字" ng-model="formData.brief"
                              name="brief" required="" ng-maxlength="100" ng-minlength="10"
                              style="padding: 5px"></textarea>
                </div>
            </div>
            <div class="form-group personal-second">
                <label class="col-sm-2 control-label"><i class="red-icon">*</i>内容：</label>
                <div class="col-sm-8 personal-head">

                    <textarea ng-keditor ng-model="formData.content" style="height: 500px"></textarea>
                    <input type="hidden" ng-model="formData.content" name="content" required="">

                </div>
            </div>


            <div class="clear"></div>

        </section>


        <footer class="container-fluid foot-wrap">
            <div class="text-center">
                <button class="btn btn-primary" type="button" style="width: 90px" w5c-form-submit="createMessage()">
                    {{'确定'}}
                </button>
                <button type="button" class="btn ims-btn" ui-sref="main.message" style="width: 90px">取消</button>
            </div>
        </footer>

    </form>


    <script type="text/ng-template" id="cpSelectModal.html">

        <div class="modal-header bg-white">
            <button type="button" class="close" ng-click="modelCancel()"><span>&times;</span></button>
            <span class="modal-title">CP选择</span>
        </div>
        <div class="modal-body ng-cloak">
            <div class="CP_head">
                <div class="CP_search">
                    <div class="form-group searchLump search-condition">
                        <div class="search-select">
                            <select ng-model="search.key"
                                    ng-options="fileName.key  as fileName.value for fileName in fileNames"></select>
                            <input type="text" class="input width-150" ng-model="search.value"
                                   ui-event="{ keyup : 'searchClick($event)' }">
                            <input type="button" class="btn btn-primary" value="搜索" style="margin-top: -5px"
                                   ng-click="searchClick()">

                        </div>
                    </div>
                    <div class="search-select">
                        <select ng-model="search.cplevel" ng-change="selectChange()">
                            <option value="">CP级别</option>
                            <option value="{{level.key}}" ng-repeat="level in levels">{{level.value}}</option>
                        </select>
                        <select ng-model="search.coopType" ng-init="search.coopType==0" ng-change="selectChange()">
                            <option value="">合作方式</option>
                            <option value="{{sign.key}}" ng-repeat="sign in signs">{{sign.value}}</option>
                        </select>
                        <select  ng-model="search.cpType" ng-change="selectChange()" ng-init="search.cpType='0'" style="margin-left: 15px" >
                            <option value="0">CP类型</option>
                            <option value="{{cpType.key}}" ng-repeat="cpType in cpTypes">{{cpType.value}}</option>
                        </select>
                    </div>
                </div>
            </div>


            <div class="row">
                <table class="table table-bordered table-hover table-page">
                    <thead>
                    <tr>
                        <th><input type="checkbox" id="allCheckbCP" class="magic-checkbox" ng-model="$parent.allCheckedCP"
                                   ng-change="allCheckChange(allChecked)">
                            <label for="allCheckbCP"></label></th>
                        <th>CP_ID</th>
                        <th>昵称</th>
                        <th>账户名</th>
                        <th>合作方式</th>
                        <th>级别</th>
                        <th>类型</th>

                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in items">

                        <td>
                            <input type="checkbox" id="{{$index}}" class="magic-checkbox" ng-model="item.checked"
                                   ng-change="itemCheckChange(item)">
                            <label for="{{$index}}"></label>
                        </td>
                        <td>
                            {{item.cpId}}
                        </td>
                        <td>
                            {{item.nickName}}
                        </td>
                        <td>
                            {{item.userName}}
                        </td>
                        <td>
                            {{table[item.coopType]}}
                        </td>
                        <td>
                            {{table[item.cplevel]}}
                        </td>
                        <td>
                            {{table[item.cpType]}}
                        </td>
                    </tr>
                    </tbody>
                </table>

                <div class="paging">
                    <s-pagination conf="paginationConf"></s-pagination>
                </div>
            </div>


        </div>
        <div class="modal-footer">
            <button class="btn btn-primary" type="button" ng-click="modelOk()">确定</button>
            <button class="btn ims-btn" type="button" ng-click="modelCancel()">取消</button>
        </div>

    </script>

</div>
